<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    xmlns:f="http://java.sun.com/jsf/core"
	    xmlns:h="http://java.sun.com/jsf/html"
	    xmlns:ui="http://java.sun.com/jsf/facelets"
	    xmlns:p="http://primefaces.prime.com.tr/ui"
	    template="/template/template.xhtml">
    
   	<ui:param name="pageTitle" value="Lista de Editais" />
   	
    <ui:define name="body">
    	<h:form>
	    	<h:outputText value="Nenhum dado encontrado" 
	    			rendered="#{empty editalController.editaisAtivos}"/>
	    	
	    	<h:dataTable value="#{editalController.editaisAtivos}" 
	    			var="_edital"  
	    			rendered="#{not empty editalController.editaisAtivos}">    		
	    		<h:column>
	    			<f:facet name="header">Data Inicio</f:facet>
	    			<h:outputText value="#{_edital.dataInicio}" />
	    		</h:column>
	    		
	    		<h:column>
	    			<f:facet name="header">Data Fim</f:facet>
	    			<h:outputText value="#{_edital.dataFim}" />
	    		</h:column>
	    		
	    		<h:column>
	    			<f:facet name="header">Descricao</f:facet>
	    			<h:outputText value="#{_edital.descricao}" />
	    		</h:column>
	    		
	    		<h:column>
	    			<f:facet name="header">Quantidade</f:facet>
	    			<h:outputText value="#{_edital.quantidade}" />
	    		</h:column>
	    		
	    		<h:column>
	    			<f:facet name="header">Preco Inicial</f:facet>
	    			<h:outputText value="#{_edital.precoInicial}" />
	    		</h:column>
	    		
	    		<h:column>
	    			<f:facet name="header">Preco Final</f:facet>
	    			<h:outputText value="#{_edital.precoFinal}" />
	    		</h:column>
	    		
	    		<h:column>
	    			<f:facet name="header">Status</f:facet>
	    			<h:outputText value="#{_edital.status}" />
	    		</h:column>
	    		
	    		<h:column>
	    			<f:facet name="header">Produto</f:facet>
	    			<h:outputText value="#{_edital.produto.nome}" />
	    		</h:column>
	    		
	    		<h:column>
	    			<f:facet name="header">Criador</f:facet>
	    			<h:outputText value="#{_edital.criador.nome}" />
	    		</h:column>
	    			    		
	    		<h:column>
	    			<h:commandButton action="#{lanceController.carregarLeilao(_edital)}"  
		    						 value="Acompanhar Leilao" />
	    		</h:column>
	    	</h:dataTable>
	    </h:form>
    </ui:define>
</ui:composition>